#include "../SypEngine.h"

#ifdef CHECKMEM
#include "../mmgr.h"
#endif
using namespace Syp;

VertexLightingShader::VertexLightingShader():Pass("VertexLightingShader","Vertex Lighting emulating the Fixed-Functionality pipeline.")
{
	if(Renderer::getRenderer().getHardwareCpbRef().VertexShaders && Renderer::getRenderer().getHardwareCpbRef().PixelShaders)
	{
		VertexShader* vs = new VertexShader("Shaders/Syp.vert");
		PixelShader* ps = new PixelShader("Shaders/Syp.frag");

		vs->compileShader();
		ps->compileShader();

		ShaderProgram* sp = new ShaderProgram("VertexLighting");
		sp->addShader(vs);
		sp->addShader(ps);
		sp->linkShaders();
		useShaderProgram(sp);
	}	
}

bool VertexLightingShader::runnableOnHardware()
{

	return true;

}

void VertexLightingShader::destroy()
{
	delete this;
}
